#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Copyright [Gtlions Lai].
# Create Date:
# Update Date:
"""summarization ahout this script.

detail ahout this script

   Class(): summarization about Class
   ...
   function(): summarization about function
   ...
"""
__authors__ = '"Gtlions Lai" <gtlions.l@qq.com>'

import sys
from PyQt4 import QtGui, QtCore


class Main(QtGui.QMainWindow):
    def __init__(self, parent=None):
        QtGui.QMainWindow.__init__(self)
        self.setWindowTitle('QMainWindow')
        self.setGeometry(300, 300, 300, 300)
        grid = QtGui.QGridLayout()
        button1 = QtGui.QPushButton(self, text='button')
        grid.addWidget(button1, 0, 0)

        self.setLayout(grid)
        # 菜单栏
        self.menubar = QtGui.QMenuBar(self)
        menus = 'a'
        actions ='bc'
        # 菜单夹 file
        for menulist in menus:
            print menulist
            menulist = menulist + 'm'
            menulist = QtGui.QMenu(self)
            menulist.setTitle('aa')
            self.menubar.addMenu(menulist)

        for actionlist in actions:
            print actionlist
            menulist = QtGui.QMenu('am')
            action = QtGui.QAction(self)
            action.setText(actionlist)
            menulist.addAction(action)

if __name__ == "__main__":
    app = QtGui.QApplication(sys.argv)
    main = Main()
    main.show()
    sys.exit(app.exec_())